﻿<UserControl
    x:Class="WinRTXamlToolkit.Sample.Views.ParallaxBackgroundBehaviorTestView"
    IsTabStop="false"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="using:WinRTXamlToolkit.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:charting="using:WinRTXamlToolkit.Controls.DataVisualization.Charting"
    xmlns:Series="using:WinRTXamlToolkit.Controls.DataVisualization.Charting"
    xmlns:Interactivity="using:WinRTXamlToolkit.Interactivity"
    xmlns:Behaviors="using:WinRTXamlToolkit.Controls.Behaviors">

    <ScrollViewer
        Style="{StaticResource HorizontalScrollViewerStyle}">
        <Interactivity:Interaction.Behaviors>
            <Behaviors:ParallaxBackgroundBehavior>
                <Behaviors:ParallaxBackgroundBehavior.BackgroundElementTemplate>
                    <DataTemplate>
                        <Rectangle
                            Width="2000"
                            Height="1000"
                            StrokeThickness="5"
                            Stroke="Red">
                            <Rectangle.Fill>
                                <LinearGradientBrush
                                    StartPoint="0,0"
                                    EndPoint="1,1">
                                    <GradientStop
                                        Offset="0"
                                        Color="Transparent" />
                                    <GradientStop
                                        Offset="1"
                                        Color="CornflowerBlue" />
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                    </DataTemplate>
                </Behaviors:ParallaxBackgroundBehavior.BackgroundElementTemplate>
            </Behaviors:ParallaxBackgroundBehavior>
            <!-- Note - ElementName binding as below doesn't work. Seems like namescope issues block it. -->
            <!--SearchString="{Binding Text, ElementName=searchBox}"-->
        </Interactivity:Interaction.Behaviors>
        <StackPanel
            Orientation="Horizontal">
            <TextBlock
                Text="Item 1"
                FontSize="72"
                Width="500" />
            <TextBlock
                Text="Item 2"
                FontSize="72"
                Width="500" />
            <TextBlock
                Text="Item 3"
                FontSize="72"
                Width="500" />
            <TextBlock
                Text="Item 4"
                FontSize="72"
                Width="500" />
            <TextBlock
                Text="Item 5"
                FontSize="72"
                Width="500" />
            <TextBlock
                Text="Item 6"
                FontSize="72"
                Width="500" />
        </StackPanel>
    </ScrollViewer>
</UserControl>